# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataMigration.V1.Model.SingleColumnChange do
  @moduledoc """
  Options to configure rule type SingleColumnChange. The rule is used to change the properties of a column. The rule filter field can refer to one entity. The rule scope can be one of: Column. When using this rule, if a field is not specified than the destination column's configuration will be the same as the one in the source column..

  ## Attributes

  *   `array` (*type:* `boolean()`, *default:* `nil`) - Optional. Is the column of array type.
  *   `arrayLength` (*type:* `integer()`, *default:* `nil`) - Optional. The length of the array, only relevant if the column type is an array.
  *   `autoGenerated` (*type:* `boolean()`, *default:* `nil`) - Optional. Is the column auto-generated/identity.
  *   `charset` (*type:* `String.t`, *default:* `nil`) - Optional. Charset override - instead of table level charset.
  *   `collation` (*type:* `String.t`, *default:* `nil`) - Optional. Collation override - instead of table level collation.
  *   `comment` (*type:* `String.t`, *default:* `nil`) - Optional. Comment associated with the column.
  *   `customFeatures` (*type:* `map()`, *default:* `nil`) - Optional. Custom engine specific features.
  *   `dataType` (*type:* `String.t`, *default:* `nil`) - Optional. Column data type name.
  *   `fractionalSecondsPrecision` (*type:* `integer()`, *default:* `nil`) - Optional. Column fractional seconds precision - e.g. 2 as in timestamp (2) - when relevant.
  *   `length` (*type:* `String.t`, *default:* `nil`) - Optional. Column length - e.g. 50 as in varchar (50) - when relevant.
  *   `nullable` (*type:* `boolean()`, *default:* `nil`) - Optional. Is the column nullable.
  *   `precision` (*type:* `integer()`, *default:* `nil`) - Optional. Column precision - e.g. 8 as in double (8,2) - when relevant.
  *   `scale` (*type:* `integer()`, *default:* `nil`) - Optional. Column scale - e.g. 2 as in double (8,2) - when relevant.
  *   `setValues` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Specifies the list of values allowed in the column.
  *   `udt` (*type:* `boolean()`, *default:* `nil`) - Optional. Is the column a UDT (User-defined Type).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :array => boolean() | nil,
          :arrayLength => integer() | nil,
          :autoGenerated => boolean() | nil,
          :charset => String.t() | nil,
          :collation => String.t() | nil,
          :comment => String.t() | nil,
          :customFeatures => map() | nil,
          :dataType => String.t() | nil,
          :fractionalSecondsPrecision => integer() | nil,
          :length => String.t() | nil,
          :nullable => boolean() | nil,
          :precision => integer() | nil,
          :scale => integer() | nil,
          :setValues => list(String.t()) | nil,
          :udt => boolean() | nil
        }

  field(:array)
  field(:arrayLength)
  field(:autoGenerated)
  field(:charset)
  field(:collation)
  field(:comment)
  field(:customFeatures, type: :map)
  field(:dataType)
  field(:fractionalSecondsPrecision)
  field(:length)
  field(:nullable)
  field(:precision)
  field(:scale)
  field(:setValues, type: :list)
  field(:udt)
end

defimpl Poison.Decoder, for: GoogleApi.DataMigration.V1.Model.SingleColumnChange do
  def decode(value, options) do
    GoogleApi.DataMigration.V1.Model.SingleColumnChange.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DataMigration.V1.Model.SingleColumnChange do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
